using System;
using System.Collections;

namespace Evaluant.Uss.Commands
{
	[Serializable]
	public class CompoundUpdateCommand : Command
	{
		public CompoundUpdateCommand(string parentId, string parentType, ICollection commands) : base(parentId)
		{
			this._ParentType = parentType;
			this._innerCommands.AddRange(commands);
            _ProcessOrder = 6;
		}

		protected string _ParentType;

		public string ParentType
		{
			get { return _ParentType; }
		}

		public override void Accept(ICommandProcessor processor)
		{
			processor.Process(this);
		}

		private ArrayList _innerCommands = new ArrayList();

		/// <summary>
		/// Gets the inner commands.
		/// </summary>
		/// <value>The inner commands.</value>
		/// <remarks>This can only be made of UpdateAttributeCommand items</remarks>
		public ArrayList InnerCommands
		{
			get { return _innerCommands; }
		}

		public override void UpdateIds(Hashtable newIds)
		{
			// Nothing to do as the entity is already exiting with its final id
		}


	}
}
